<template>
    <div class="box">
        <div class="myHead">
            <div class="an" @click="fanHui"><van-icon name="arrow-left"  color="#f0f0f0"/></div>
            <div class="ti">喵喵</div>
        </div>
       <div class="box1" >
           <ul>
               <li v-for="(item,index) in arr"
               :key="(index)"
               @click="xianqing(item.id)"
               >
                   <div class="box2">
                       <div class="tubox">
                           <img :src="item.poster" alt="">
                       </div>
                       <div class="use">
                           <div class="headline">
                               <div class="nm">{{item.name}}</div>
                               <div v-if="item.score">{{item.score}}分</div>
                           </div>
                           <div class="zz">{{item.ename}}</div>
                           <div class="cat">{{item.catogary}}</div>
                           <div class="time">{{item.release}}</div>
                       </div>
                   </div>
                   <div class="gou">购票</div>
               </li>
           </ul>
       </div>
    </div>
</template>
<script>
export default {
  data() {
    return {
      arr:null
    };
  },
 
  methods: {
    //   搜索建议
     
      fanHui(){
          this.$router.back()
      },
       xianqing(a){
      this.$router.push({name:'XiangQing',params:{id:a}})
    },
  
  },
  created(){
      let a = this.$route.query.value
      console.log(a);
      let Po = this.axios.get(`search/movies?keyword=${a}&ci=1`)
      Po.then(re=>{
          console.log(re.data);
          this.arr = re.data
      })

  }
};
</script>
<style lang="less" scoped>
.box{

    .myHead{
        width: 100%;
        height: 50px;
        background-color: #e54847!important;
        display: flex;
        // vertical-align: middle;
        line-height: 50px;
        
        .an{
            padding: -0 10px;

        }
        .ti{
            font-size: 20px;
            color: white;
            margin-left: 33%;
        }

    }
    .box1{
        width: 100%;
        box-sizing: border-box;
        padding: 10px;
        ul{
            box-sizing: border-box;
            li{
                box-sizing: border-box;
                position: relative;
                .gou{
                    position: absolute;
                    right: 5px;
                    top: 50%;
                    text-align: center;
                    font-size: 10px;
                    padding: 1px;
                    box-sizing: border-box;
                    width: 42px;
                    height: 20px;
                    border: 1px solid red;
                    border-radius: 15px;
                    color: white;
                    background-color: #e54847;
                }
                border-top: 1px solid #f0f0f0;
                border-bottom: 1px solid #f0f0f0;
                padding: 10px 0;

                .box2{
                    display: flex;
                    .tubox{
                        width: 64px;
                        height: 90px;
                        img{
                            width: 64px;
                            height: 90px;
                        }

                    }
                    .use{
                        box-sizing: border-box;
                        width: 80%;
                        >div{
                            margin-bottom: 5px;
                            color: #666;

                        }
                        margin-left: 15px;
                        font-size: 15px;
                        .headline{
                            display: flex;
                            justify-content: space-between;
                            box-sizing: border-box;
                            >div{
                                font-size: 10px;
                                &:nth-child(1){
                                    width: 70%;
                                    font-size: 17px;
                                    font-weight: 700;
                                    color: black;
                                    white-space:nowrap;
                                    overflow:hidden;
                                    text-overflow:ellipsis


                                }
                                &:nth-child(2){
                                    // margin-left: auto;
                                    color: #FFBC00;
                                    margin-right: 5px;
                                    font-size: 15px;
                                }
                            }

                        }
                        .zz{
                            color: #666;
                            width: 150px;
                             white-space:nowrap;
                            overflow:hidden;
                             text-overflow:ellipsis
                            

                        }
                        .time{
                            color: #666;

                        }
                    }
                }
            }
        }
    }
}
</style>